<template>
  <div>
    <MyHeader backgroundcolor="green" color="pink" title="日月轮转" />
    <div class="ssss">
      <MyGoods v-for="obj in goodsList" :key="obj.id" :goodsObj="obj" />
    </div>

    <MyFooter :arr="goodsList" />
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader";
import MyGoods from "./components/MyGoods";
import MyFooter from "./components/MyFooter";
export default {
  components: {
    MyHeader,
    MyGoods,
    MyFooter,
  },
  created() {
    this.getList();
  },
  data() {
    return {
      goodsList: [],
    };
  },
  methods: {
    getList() {
      this.$axios({
        url: "https://www.escook.cn/api/cart",
      }).then((res) => {
        this.goodsList = res.data.list;
      });
    },
  },
};
</script>

<style scoped>
.ssss {
  padding-top: 45px;
  padding-bottom: 50px;
}
</style>